Current software products that scan computer files for malicious code infections (viruses, worms, and Trojan horses) have a particularly difficult problem when the computer file has been infected by an unknown secondary infection (normally a viral infection). As used throughout this patent application, “secondary” means a second or higher order infection. For example, a piece of code containing a Trojan horse or a worm might be secondarily infected by a virus. Such a secondary infection changes the signature and make-up of the original Trojan or worm program, and quite often causes the antivirus software product to miss the infection.
Furthermore, even if the antivirus software product can detect the secondary viral infection, there may still be problems. If the antivirus software product detects and repairs the secondary infection, leaving the original Trojan/worm code, the repair often does not restore the Trojan/worm to its original form, and thus the signature of the Trojan/worm is different than the uninfected version of the Trojan/worm. Consequently, the repaired version of the Trojan/worm may also very well be missed by the antivirus software product.
The above-described problems are present whether or not the antivirus software product detects viruses with traditional fingerprints or with hashes of files (i.e., comparing the hash of a file against hashes of known malicious code). This is because hashes of the repaired or secondarily infected malicious code are likewise different from the hashes of the original uninfected malicious code, when the repaired or secondarily infected malicious code is different from the original uninfected malicious code.
The above-described problems are quite common, particularly in the Win32 environment (i.e., for computer files that operate under a 32 bit Windows operating system manufactured by Microsoft Corporation). Most prior art antivirus scanners use traditional virus signatures; or, alternatively, use full file CRC's (Cyclic Redundancy Checks) or CRC's based on the code section and/or headers of executable files. These methods fail to detect infections in many circumstances. The prior art has heretofore not been able to produce a technique that yields both a very low false positive rate as well as properly dealing with secondary infections (repaired or not). These deficiencies of the prior art are remedied by the present invention, which offers the further advantage of being able to detect closely related minor variants of the same malicious code.